home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbtable.dxr / 00011_body subtable.ls < prev    next >
Encoding:
Text File  |  2000-01-18  |  1.6 KB  |  65 lines

  1. property ancestor
  2.  
  3. on new me, tableName, castName, tableChannel, xLoc, vSlider, HSlider, descendant
  4.   if objectp(descendant) then
  5.     PassVar = descendant
  6.   else
  7.     PassVar = me
  8.   end if
  9.   ancestor = new(script("subtable object"), tableName, castName, tableChannel, xLoc, vSlider, HSlider, PassVar)
  10.   return me
  11. end
  12.  
  13. on trackMouse me
  14.   startCell = cellToPoint(me._me, sprite(me.pTableChannel).mouseCell)
  15.   trackMouse(me.pSuperTable, startCell)
  16.   return me
  17. end
  18.  
  19. on getSelectedData me, theRect
  20.   selectedData = getSelectedData(ancestor, theRect)
  21.   if the machineType = 256 then
  22.     FindText = numToChar(160)
  23.   else
  24.     FindText = numToChar(202)
  25.   end if
  26.   MaxCount = count(selectedData)
  27.   repeat with rc = 1 to MaxCount
  28.     xText = getAt(selectedData, rc)
  29.     xText = RemoveString(xText, FindText)
  30.     setAt(selectedData, rc, xText)
  31.   end repeat
  32.   return selectedData
  33. end
  34.  
  35. on CalcCenterofRect me, xRect
  36.   if the machineType = 256 then
  37.     l = getAt(xRect, 1)
  38.     t = getAt(xRect, 2)
  39.     R = getAt(xRect, 3)
  40.     b = getAt(xRect, 4)
  41.     xCenter = (R - l) / 2
  42.     if ((l mod 2) = 1) and ((R mod 2) = 1) then
  43.       xCenter = xCenter - 1
  44.     end if
  45.     if ((l mod 2) = 0) and ((R mod 2) = 0) then
  46.       xCenter = xCenter - 1
  47.     end if
  48.     if ((l mod 2) = 1) and ((R mod 2) = 0) then
  49.       xCenter = xCenter - 1
  50.     end if
  51.     yCenter = (b - t) / 2
  52.     if ((t mod 2) = 1) and ((b mod 2) = 1) then
  53.       yCenter = yCenter - 2
  54.     end if
  55.     xPoint = point(l + xCenter, t + yCenter)
  56.   else
  57.     xPoint = RectToLoc(xRect)
  58.   end if
  59.   return xPoint
  60. end
  61.  
  62. on GetScrollNeeds me
  63.   return [#v: me.pMemHeight > (me.pSpriteHeight + 1), #h: me.pMemWidth > (me.pSpriteWidth + 1)]
  64. end
  65.